import dayjs from 'dayjs'

//加密字符串,可以先将中文加密，然后再用btoa加密
export function encryption(str) {
  let encStr = encodeURIComponent(str)
  encStr = btoa(encStr)

  return encStr
}

//解密，可以先将ascii解密，然后再将非ascii解密
export function decrypt(str) {
  let decStr = atob(str)
  decStr = decodeURIComponent(decStr)
  return decStr
}

export function formateDate(value) {
  return dayjs(value).format('YYYY-MM-DD HH:mm:ss')
}
